package com.ofhb.entities;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@SuppressWarnings("serial")
@Entity
@Table(name="ofhb_user")
public class UserEntity implements Serializable {
	/*
		id serial NOT NULL,
		user_name character(64) NOT NULL,
		password character(256) NOT NULL,
		created_date timestamp with time zone NOT NULL,
		first_name character(64) NOT NULL,
		middle_name character(64) NOT NULL,
		last_name character(64) NOT NULL,
		address_line_1 character(256) NOT NULL,
		address_line_2 character(256),
		city character(64) NOT NULL,
		state character(2) NOT NULL,
		pin_code numeric(6,0) NOT NULL,
		security_question character(256) NOT NULL,
		security_answer character(64) NOT NULL,
		dob date,
		last_login_time timestamp with time zone NOT NULL,
		locked boolean NOT NULL DEFAULT false,
		active boolean NOT NULL DEFAULT true,
		security_answer_hint character(256),
		primary_mobile numeric(10,0) NOT NULL,
		secondary_mobile numeric(10,0),
		primary_email character(256) NOT NULL,
		secondary_email character(256),
		user_type character(64) NOT NULL,
	 */
	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	@Column(name="user_name")
	private String userName;
	
	@Column(name="password")
	private String password;
	
	@Column(name="created_date")
	@Temporal(value = TemporalType.DATE)
	private Date createdDate;
	
	@Column(name="first_name")
	private String firstName;
	
	@Column(name="middle_name")
	private String middleName;
	
	@Column(name="last_name")
	private String lastName;
	
	@Column(name="address_line_1")
	private String addressLine1;
	
	@Column(name="address_line_2")
	private String addressLine2;
	
	@ManyToOne
	@JoinColumn(name="city", referencedColumnName ="id")
	private CityEntity cityEntity;
	
	@Column(name="pin_code")
	private Long pinCode;
	
	@Column(name="security_question")
	private String securityQuestion;
	
	@Column(name="security_answer")
	private String securityAnswer;
	
	@Column(name="security_answer_hint")
	private String securityAnswerHint;
	
	@Column(name="dob")
	@Temporal(value = TemporalType.DATE)
	private Date dob;
	
	@Column(name="last_login_time")
	@Temporal(value = TemporalType.DATE)
	private Date lastToginTime;
	
	@Column(name="locked")
	private Boolean locked;
	
	@Column(name="active")
	private Boolean active;
	
	@Column(name="primary_mobile")
	private Long primaryMobile;
	
	@Column(name="secondary_mobile")
	private Long secondaryMobile;
	
	@Column(name="primary_email")
	private String primaryEmail;
	
	@Column(name="secondary_email")
	private String secondaryEmail;

	@ManyToOne
	@JoinColumn(name="user_type_id", referencedColumnName ="id")
	private UserTypeEntity userTypeEntity;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getMiddleName() {
		return middleName;
	}

	public void setMiddleName(String middleName) {
		this.middleName = middleName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getAddressLine1() {
		return addressLine1;
	}

	public void setAddressLine1(String addressLine1) {
		this.addressLine1 = addressLine1;
	}

	public String getAddressLine2() {
		return addressLine2;
	}

	public void setAddressLine2(String addressLine2) {
		this.addressLine2 = addressLine2;
	}

	public Long getPinCode() {
		return pinCode;
	}

	public void setPinCode(Long pinCode) {
		this.pinCode = pinCode;
	}

	public String getSecurityQuestion() {
		return securityQuestion;
	}

	public void setSecurityQuestion(String securityQuestion) {
		this.securityQuestion = securityQuestion;
	}

	public String getSecurityAnswer() {
		return securityAnswer;
	}

	public void setSecurityAnswer(String securityAnswer) {
		this.securityAnswer = securityAnswer;
	}

	public String getSecurityAnswerHint() {
		return securityAnswerHint;
	}

	public void setSecurityAnswerHint(String securityAnswerHint) {
		this.securityAnswerHint = securityAnswerHint;
	}

	public Date getDob() {
		return dob;
	}

	public void setDob(Date dob) {
		this.dob = dob;
	}

	public Date getLastToginTime() {
		return lastToginTime;
	}

	public void setLastToginTime(Date lastToginTime) {
		this.lastToginTime = lastToginTime;
	}

	public Boolean getLocked() {
		return locked;
	}

	public void setLocked(Boolean locked) {
		this.locked = locked;
	}

	public Boolean getActive() {
		return active;
	}

	public void setActive(Boolean active) {
		this.active = active;
	}

	public Long getPrimaryMobile() {
		return primaryMobile;
	}

	public void setPrimaryMobile(Long primaryMobile) {
		this.primaryMobile = primaryMobile;
	}

	public Long getSecondaryMobile() {
		return secondaryMobile;
	}

	public void setSecondaryMobile(Long secondaryMobile) {
		this.secondaryMobile = secondaryMobile;
	}

	public String getPrimaryEmail() {
		return primaryEmail;
	}

	public void setPrimaryEmail(String primaryEmail) {
		this.primaryEmail = primaryEmail;
	}

	public String getSecondaryEmail() {
		return secondaryEmail;
	}

	public void setSecondaryEmail(String secondaryEmail) {
		this.secondaryEmail = secondaryEmail;
	}

	public UserTypeEntity getUserTypeEntity() {
		return userTypeEntity;
	}

	public void setUserTypeEntity(UserTypeEntity userTypeEntity) {
		this.userTypeEntity = userTypeEntity;
	}

	public CityEntity getCityEntity() {
		return cityEntity;
	}

	public void setCityEntity(CityEntity cityEntity) {
		this.cityEntity = cityEntity;
	}
}
